<?php

namespace App\Library\KfHttp;

use GuzzleHttp\Exception\GuzzleException;

/**
 * 调用rms的curl方法
 */
class OrmCurl extends BaseKfCurl
{
    protected function __construct()
    {
        parent::__construct();
        $this->setDomain(config('InternalAPI.domain.orm'));
//        $this->setDomain('https://kfos-admin.51kuafu.com/');
//        $this->setDomain('https://qa-orm.51kuafu.com/');
    }

    /**
     * 查询订货明细
     *
     * @param array $codes
     * @param int $withGoods
     * @return array
     * @throws GuzzleException
     */
    public static function queryOrderByCodes(array $codes, int $withGoods = 0): array
    {
        return self::getIns()
                   ->do('internal/newOrder/getNewOrderByCodes',
                       [
                           'code'      => implode(',', $codes),
                           'withGoods' => $withGoods
                       ],
                       'GET');
    }
}
